from selenium.webdriver.common.by import By

class AdminCouponPromoCrowdLocator:
    # Promo Management 菜单
    promo_management_menu = (By.XPATH, "//div[contains(@data-menu-id,'PROMO_MANAGER')]")

    # promo crowd 菜单
    promo_crowd_menu = (By.CSS_SELECTOR, '[path="/console/promoCrowd"]')

    # 新增promo crowd 按钮
    add_promo_crowd_button = (By.XPATH, '//*[@id="root"]/section/section/main/div/div/div/div[1]/div[1]/div/span/button')
    # promo crowd name
    promo_crowd_name_input = (By.XPATH, "//input[contains(@placeholder,'Enter name')]")
    # ok按钮
    add_promo_crowd_ok_button = (By.XPATH, '/html/body/div[3]/div/div[2]/div/div[2]/div[3]/button[2]')
    # 搜索框
    search_input = (By.XPATH, "//input[contains(@placeholder,'Search')]")
    # promo_crowd_name_input = (By.XPATH, '//*[@id="userGroupName"]')
    # 搜索promo crowd按钮
    promo_crowd_search_button = (By.XPATH, '//*[@id="root"]/section/section/main/div/div/div/div[1]/div[1]/form/div/div/div/div/span/span/span/button')

    # 第一个查询结果
    first_search_result = (By.XPATH, '//*[@id="scrollableDiv"]/div/div/div/div/div/ul/li/div')

    # 新增成员按钮
    add_member_button = (By.XPATH, '//span[text() = "Add User"]')
    # 新增成员的email输入框
    add_member_input = (By.XPATH, '//*[@id="email"]')
    # 添加成员ok 按钮
    # add_member_ok_button = (By.XPATH, '/html/body/div[9]/div/div[2]/div/div[2]/div[3]/button[2]')
    add_member_ok_button = (By.XPATH, '//span[text() = "OK"]')


    # 成员搜索输入框
    member_search_input = (By.XPATH, "//input[contains(@placeholder,'Account email/Phone number')]")
    # 成员搜索按钮
    # member_search_button = (By.XPATH, '//*[@id="rc-tabs-2-panel-1"]/div[1]/form/div/div/div/div/span/span/span/button')
    member_search_button = (By.XPATH, "(//button[contains(@class,'antd4-btn antd4-btn-default antd4-btn-icon-only antd4-input-search-button')])[2]")

    # 第一个成员查询结果
    first_member_search_result = (By.XPATH, '(//div[contains(@class,"tableEmail")])[1]')
    first_member_search_result_email = (By.XPATH, '(//div[contains(@class,"tableEmail")])[1]')
    # first_member_search_result_phone = (By.XPATH, '//*[@id="rc-tabs-0-panel-1"]/div[2]/div/div/div/div/div/table/tbody/tr[2]/td[5]/div/div')
    first_member_search_result_phone = (By.XPATH, '(//div[contains(@class,"ellipsis")])[2]')
    #Remove User按钮
    first_member_search_result_remove_member_button = (By.XPATH, '//span[text() = "Remove User"]')
    # 删除成员确认勾选
    delete_promo_crowd_member_check_box = (By.XPATH, '//*[@id="checked"]/label/span[1]/input')
    #删除成员确认按钮
    delete_promo_crowd_member_ok_button = (By.XPATH, '//span[text() = "OK"]')



    ######## 成员列表属性
    # account email
    member_list_account_email = (By.XPATH, '//th[text() = "Account Email"]')
    # account type
    member_list_account_type = (By.XPATH, '//th[text() = "Account Type"]')
    # status
    member_list_status = (By.XPATH, '//span[text() = "Status"]')
    # User Name
    member_list_user_name = (By.XPATH, '//th[text() = "User Name"]')
    # Phone Number
    member_list_phone_number = (By.XPATH, '//th[text() = "Phone Number"]')
    # Creation Time
    member_list_creation_time = (By.XPATH, '//th[text() = "Creation Time (UTC+08:00)"]')


    #action按钮
    action_button = (By.XPATH, "//button[contains(@class,'antd4-btn antd4-btn-default antd4-dropdown-trigger')]")
    # 编辑按钮
    edit_promo_crowd_button = (By.XPATH, '//span[text() = "Edit"]')
    #编辑页面的name输入框
    edit_name_input = (By.XPATH, "//input[contains(@placeholder,'Enter name')]")
    #编辑页面的description输入框
    edit_description_input = (By.XPATH, "//textarea[contains(@placeholder,'Enter description')]")
    #编辑ok 按钮
    edit_promo_crowd_ok_button = (By.XPATH, '//span[text() = "OK"]')
    #promo crowd头像旁边的name
    promo_crowd_name = (By.XPATH, '//*[@id="root"]/section/section/main/div/div/div/div[2]/div/div/div/div/div[2]/div/div[1]/div[2]/div[1]/h3')
    # promo crowd头像旁边的description
    promo_crowd_description = (By.XPATH, "//p[contains(@class,'groupDis')]")

    #删除promo crowd按钮
    delete_promo_crowd_button = (By.XPATH, '//span[text() = "Delete"]')
    #删除promo crowd 确认勾选框
    delete_promo_crowd_check_box = (By.XPATH, '//*[@id="checked"]/label/span[1]/input')
    #删除promo crowd 确认勾选框
    delete_promo_crowd_ok_button = (By.XPATH, '//span[text() = "OK"]')

















